package com.atan.weblog.admin.controller;

import com.atan.weblog.admin.service.AdminFileService;
import com.atan.weblog.common.aop.ApiOperationLog;
import com.atan.weblog.common.utils.ResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/admin")
@Api(tags = "Admin 文件模块")
public class AdminFileController {

    @Autowired
    private AdminFileService adminFileService;

    @PostMapping("/file/upload")
    @ApiOperationLog(description = "上传文件")
    @ApiOperation(value = "上传文件")
    public ResponseUtil uploadFile(@RequestPart("file") MultipartFile file){
         return adminFileService.uploadFile(file);

    }
}
